package router

import (
	jwt "gitee.com/sansaniot/ssiot-core/httpmvc/jwtauth"
	"github.com/gin-gonic/gin"

	"ssdevice/internal/device/apis"
)

func init() {
	RouterCheckRole = append(RouterCheckRole, registerTagRouter)
}

func registerTagRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.Tag{}
	r := v1.Group("/api/tag").Use(authMiddleware.MiddlewareFuncWithOutValidate())
	{
		r.GET("/find", api.FindPage)               // 分页查询
		r.GET("/get", api.FindOne)                 // 单个查询
		r.POST("/add", api.AddTag)                 // 新增标签
		r.POST("/remove", api.RemoveTag)           // 删除标签
		r.GET("/dev-stats", api.GetTagDeviceStats) // 获取标签统计信息
	}
}
